#include <stdio.h>
#include <math.h>

int main()
{
    float x;
    float result;
    scanf("%f",&x);
    if(x < 0){
        result = powf(x + 1, 2) + 2 * x + 1 / x;
    }
    else {
        result = sqrtf(x);
    }
    printf("f(%.2f) = %.2f",x,result);

    return 0;
}